From 4092caa643fa1103fbbdc96948f500c4a5c1f4cd Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 28 Feb 2007 18:06:56 +0000 Subject: [PATCH] Fix init.d/xendomains startup script so log_error and log_success will also work on redhat-based distributions before RHEL 5. See discussion "xendomains init script" about a year ago on xen-devel. Signed-off-by: Florian Kirstein --- tools/examples/init.d/xendomains | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/tools/examples/init.d/xendomains b/tools/examples/init.d/xendomains index 7aca157bc9..461037e3ac 100644 --- a/tools/examples/init.d/xendomains +++ b/tools/examples/init.d/xendomains @@ -58,18 +58,7 @@ else _SMSG=(done failed failed missed failed skipped unused failed failed) _RC_UNUSED=6 fi - if test -e /lib/lsb/init-functions; then - # LSB - . /lib/lsb/init-functions - echo_rc() - { - if test ${_RC_RV} = 0; then - log_success_msg " [${_SMSG[${_RC_RV}]}] " - else - log_failure_msg " [${_SMSG[${_RC_RV}]}] " - fi - } - elif test -e /etc/init.d/functions; then + if test -e /etc/init.d/functions; then # REDHAT . /etc/init.d/functions echo_rc() @@ -81,6 +70,24 @@ else failure " [${_SMSG[${_RC_RV}]}] " fi } + elif test -e /lib/lsb/init-functions; then + # LSB + . /lib/lsb/init-functions + if alias log_success_msg >/dev/null 2>/dev/null; then + echo_rc() + { + echo " [${_SMSG[${_RC_RV}]}] " + } + else + echo_rc() + { + if test ${_RC_RV} = 0; then + log_success_msg " [${_SMSG[${_RC_RV}]}] " + else + log_failure_msg " [${_SMSG[${_RC_RV}]}] " + fi + } + fi else # emulate it echo_rc() -- 2.30.2